package org.springblade.modules.notice.core.channel;

import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author ysq
 * @Date 2024/11/21
 * @Description 通知处理策略工厂
 */
@Component
public class NoticeHandlerFactory {


	private final Map<Integer, NoticeHandler> noticeStrategy = new HashMap<>(8);

	public void register(Integer channelCode, NoticeHandler handler) {
		noticeStrategy.put(channelCode, handler);
	}

	public NoticeHandler getHandler(Integer channelCode) {
		return noticeStrategy.get(channelCode);
	}
}
